package com.yaoyong.yy_demo.module.spring5.event;

import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * @author 86188
 */
@Component
public class DemoListener implements ApplicationListener<DemoEvent> {
    /**
     * 处理监听到的事件(消息)
     * @param event
     */
    @Override
    public void onApplicationEvent(DemoEvent event) {
        String msg = event.getMsg();
        System.out.println("我(bean-demoListener)接受到了 bean-demoPublisher 发布的消息:"+msg);
    }
}
